<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page language="java" import="com.soft.model.*"%>
<%@ page language="java" import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<link rel="stylesheet" href="../../css/common.css" />
		<div class="title-area bg-color-black font-normal font-white">乌托邦别墅预定管理平台>内容管理>编辑权限</div>
	
	<!-- permission detail -->
	<div class="edit-area">
		<div class="container">
			<div class="row">
				<div class="title">编辑权限</div>
			</div>
			<form action="permission_doupd" method="post">
				<input type="hidden" name="id" value="${permission.id}">
			<div class="row">
				<div class="label must">权限名称</div>
				<input name="permissionName" type="text" class="edit" value="${permission.permissionName}"/>
			</div>
			<div class="row">
				<div class="label must">权限内容</div>
				<input name="permissionContext" type="text" class="edit" value="${permission.permissionContext}"/>
			</div>
			<div class="row">
				<div class="label must">父级权限</div>
				<select name="parentId" class="edit">
					<option value="0">==父级权限==</option>
					<%	
						Permission permission =(Permission) request.getAttribute("permission");
						int p1_id = 0;
						if(permission != null){
							p1_id = permission.getParentId();
						}
						List<Permission> list_p1 = (List<Permission>)request.getAttribute("list_p1");
						if(list_p1!=null && list_p1.size()>0){
							for(Permission p1 : list_p1){
								String selected = "";
								if(p1.getId() == p1_id){
									selected ="selected";
								}
					%>
					<option value="<%=p1.getId() %>" <%=selected %>><%=p1.getPermissionName() %></option>
					<%			
							}
						}
					%>
				</select>
			</div>
			<div class="row">
				<span style="color: red;font-size: xx-small;">${errMsg}</span>
<!-- 					<button id="cancel" class="font-white button-del font-normal">取消</button> -->
				<button id="save" class="font-white button-put font-normal">保存</button>
			</div>
			</form>
		</div>
	</div>
		
</html>